﻿(function () {
    "use strict";

    var userStore = Ext.StoreMgr.lookup('SafeBox.Store.UserStore');

    WinJS.UI.Pages.define("/pages/welcome/welcome.html", {
        // This function is called whenever a user navigates to this page. It
        // populates the page elements with the app's data.
        ready: function (element, options) {
            // TODO: Initialize the page here.
            if (userStore.getCount() != 0) {
                setImmediate(function () {
                    WinJS.Navigation.navigate("/pages/login/login.html");
                    //WinJS.Navigation.navigate("/pages/home/home.html");
                });
                return;
            }

            $('#-get-start').click(function () {
                WinJS.Navigation.navigate("/pages/register/register.html");
            });
        }
    });
})();
